﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication7
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack) { Response.Write(""); }
        }
        //Response.Write("用户");
        protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
        {
            var Us = Login1.UserName;
            var pad = Login1.Password;
            string sql =string.Format("select *from Uesrs where  Uesrname='{0}'", Us);
            var da = DbHelper.GetData(sql);
            if (da.Rows.Count > 0)
            {
                var isa = (bool)da.Rows[0].ItemArray[3];
                var isd = (bool)da.Rows[0].ItemArray[4];
                if (isd) { Response.Write("用户已注销"); } else {
                    if (isa) {
                        string pawd = (string)da.Rows[0].ItemArray[1];
                        if (pawd == pad) {
                            Response.Redirect("About.aspx");
                        } else { Response.Write("用户密码错误"); }  
                    } else { Response.Write("用户已冻结"); }
                }
            }
            else { Response.Write("用户不存在"); }
            
        }
    }
}